package com.lst.api.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Frank
 * @date: 2019/12/30 14:33
 * @version: V1.0
 */
public enum InsurancePayWayEnum {

    BY_MONTH("0", "月缴"),
    BY_YEAR("1", "年缴");

    InsurancePayWayEnum(String key, String value){
        this.key = key;
        this.value = value;
    }

    private String key;
    private String value;

    private static final Map<String, InsurancePayWayEnum> KEY_MAP = new HashMap<>();

    static{
        for (InsurancePayWayEnum item : InsurancePayWayEnum.values()) {
            KEY_MAP.put(item.getKey(), item);
        }
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static InsurancePayWayEnum getByKey(String key) {
        return KEY_MAP.get(key);
    }
}
